﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using CommunitySystemModel;
using CommunitySystem.BO.AdvancedCustomerQuery;
using CommunitySystemModel.AdvancedCustomerQuery;
using System.Collections.ObjectModel;
using System.Xml.Linq;

namespace CommunitySystem.Web.Service
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "CustomerQuery" in code, svc and config file together.
    public class CustomerQuery : ICustomerQuery
    {
        private CustomerQueryBO bo = null;
        public CustomerQuery()   
        {
            bo = new CustomerQueryBO();
        }
        public void DoWork()
        {
        }

        public bool AddQuery_ColumnCollection(Query_ColumnCollection entity)
        {
            return bo.AddQuery_ColumnCollection(entity);
        }


        public bool DeleteQuery_ColumnCollection(int id)
        {
            return bo.DeleteQuery_ColumnCollection(id);
        }

        public System.Collections.ObjectModel.ObservableCollection<Query_ColumnCollection> GetQuery_ColumnCollection(string condition)
        {
            return bo.GetQuery_ColumnCollection(condition);
        }


        public bool SaveQuery_CustomerQuery(CommunitySystemModel.AdvancedCustomerQuery.Query_CustomerQuery entity)
        {
            return bo.SaveQuery_CustomerQuery(entity);
        }

        public System.Collections.ObjectModel.ObservableCollection<CommunitySystemModel.AdvancedCustomerQuery.Query_CustomerQuery> GetQuery_CustomerQuery(string condition)
        {
            return bo.GetQuery_CustomerQuery(condition);
        }

        public bool DeleteQuery_CustomerQuery(int id)
        {
            return bo.DeleteQuery_CustomerQuery(id);
        }


        public ObservableCollection<Query_ColumnValue> GetValues(string _type, string sql, string loginUserID)
        {
            return bo.GetValues(_type, sql, loginUserID);
        }


        public string QueryData(int Query_CustomerQueryID, string orgids, int Year)
        {
            return bo.QueryData(Query_CustomerQueryID, orgids, Year);
        }

        public string QueryDetailInfo(XElement cell, Query_ShowColumn[] columns)
        {
            return bo.QueryDetailInfo(cell, columns);
        }

        public ObservableCollection<string> GetRecords(string type)
        {
            return bo.GetRecords(type);
        }
    }
}
